﻿@model KnowledgeCommunity.Model.Trouble

@{
    ViewBag.Title = "Details";
}

<div class="path one columns">问题解答</div>

<div class="columns three-fourths">
    <div class="post">
    
    <div class="postinfo">
        <div class="clear"></div>
        <div class="title">问题检索</div>
    </div>
    <div class="resume">
        <h3>问题说明</h3>
        @(new MvcHtmlString(Model.Content))
        <div class="clear"></div>
    </div>
    </div>

    <div id="comments">
    @foreach (var item_C in (IEnumerable<KnowledgeCommunity.Model.Answer>)ViewData["AnswerList"])
    {
        <div class="comment">
            <div class="line"></div>
            <div class="image"><img src="@Url.Content("~/Content/images/user_1.png")" alt="user" /></div>
            <div class="commentcontent">
            <div class="date"> <a href="#">Replay</a> @item_C.AddTime.ToShortTimeString() by @item_C.UserName </div>
            <p>@item_C.Content</p>
            </div>
        </div>
    }
    <div class="clear"></div>

    <div class="commentform">
        @using (Html.BeginForm("AnswerCreate", "Trouble", FormMethod.Post, new { enctype = "multipart/form-data" }))
        {
            @Html.ValidationSummary(true)
            @Html.HiddenFor(model => model.Id)
            @Html.HiddenFor(model => model.ShapeCode)
            <p>问题答复</p>
                <textarea id="message" name="message" rows="3" cols="10"></textarea>
            <br/>
            <input class="button" name="Send" type="submit" value="确定" />
        }
    </div>
    </div>

</div>


<div class="columns four_last">
  <div class="sidebar">
    <div class="title">问题： @Model.Title</div>
    <div class="title">状态： @Enum.GetName(typeof(KnowledgeCommunity.Service.Enum.TroubleState), Model.State)</div>
    <div class="title">发起者： @Model.UserName</div>
    <div class="title">提问时间： @Model.AddTime.ToString("yyyy-mm-dd")</div>
    <ul>
        <li><a href="#">收藏</a></li>
        @{
            if (HttpContext.Current.User.IsInRole("admin") || HttpContext.Current.User.IsInRole("editor"))
            {
                <li><a href="@Url.Action("Edit", "Tribune", new { id = Model.Id })">编辑</a></li> 
                <li><a href="@Url.Action("Delete", "Tribune", new { id = Model.Id })">删除</a></li> 
            }
        }
    </ul> 
    </div>
</div>
<div class="clear"></div>
